﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
/*
    2012-2-17 David检查正常
 */
namespace BenefitHelper.Config
{
    /// <summary>
    /// 全局权限配置
    /// </summary>
    public class GlobalPrower
    {
        /// <summary>
        /// 判断用户是否等访问系统(这个方法没有实现，因为还没有确定一些具体的权限)
        /// </summary>
        /// <returns></returns>
        public bool AllowLogin(DB.DBManager db)
        {
            //bool allow = false;
            //Common.Web.Cookie cookie = new Common.Web.Cookie();
            //string operatorid = cookie.GetCookie("LoginUserId");
            //if (!string.IsNullOrEmpty(operatorid))
            //{
            //    #region  登录权限判断

            //    #endregion
            //}
            //return allow;
            return true;
        }
        /// <summary>
        /// 查询系统是否具有权限执行某项功能
        /// </summary>
        /// <param name="prowerName"></param>
        /// <returns></returns>
        public bool HasPrower(string prowerName, DB.DBManager db)
        {
            bool hasprower = false;
            //var query = db.GlobalPrower.Where(a => a.ProwerName.Equals(prowerName));
            //hasprower = query.First().IsAllow;
            return hasprower;
        }
    }
}